Skip to content

Conversation

@Xenius97
Copy link
Contributor

Fixes #3578

This PR improves the moveObject functionality. From now on, all moving objects are detected by colshapes and markers, and two new events have also been added.

addEventHandler("onResourceStart", resourceRoot, function()
    local col = createColSphere(0, 0, 3, 5)
    local obj = createObject(919, 50, 0, 3)
    if obj then
        moveObject(obj, 4000, -10, 0, 3)
    end

    addEventHandler("onColShapeHit",col,function(element,dim)
        iprint(eventName, element, dim, getTickCount(), isElementWithinColShape(element, col))
        outputChatBox("Colshape (server) hit by element: " .. getElementType(element) .. ", dimension: " .. tostring(dim))
    end)
end)

addEventHandler("onObjectMoveStart", root, function(...)
    iprint("Object move started", source, getTickCount(), ...)
end)

addEventHandler("onObjectMoveStop", root, function(...)
    iprint("Object move stopped", source, getTickCount(), ...)
end)

@FileEX FileEX added enhancement New feature or request bugfix Solution to a bug of any kind labels Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onColShapeHit event isn't fired when an object goes through a colshape via moveObject

2 participants